// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   ChartLoader.java

package com.java4less.rchart;

import android.content.res.AssetManager;
import android.util.Log;
import com.java4less.rchart.gc.ChartColor;
import com.java4less.rchart.gc.ChartFont;
import com.java4less.rchart.gc.GraphicsProvider;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;

// Referenced classes of package com.java4less.rchart:
//			DataSerie, Scale, LogScale, Axis, 
//			Legend, JDBCSource, Title, HAxisLabel, 
//			VAxisLabel, LinePlotter, CurvePlotter, LineStyle, 
//			LineDataSerie, MaxMinDataSerie, FillStyle, LinePlotter3D, 
//			RadarPlotter, BarDataSerie, BarPlotter3D, BarPlotter, 
//			PieDataSerie, PiePlotter, GaugeDataSerie, GaugePlotter, 
//			Chart, AxisTargetZone, TargetZone

public class ChartLoader
{

	public String fileEncoding;
	public AssetManager assets;
	private JDBCSource jdbcsource;
	private Object parentComponent;
	public Chart gChart;
	public boolean paintDirect;
	String ptitle;
	String ptitleFont;
	String ptitleColor;
	String Y2label;
	String Y2labelFont;
	String Y2labelColor;
	String Xlabel;
	String Ylabel;
	String XlabelFont;
	String YlabelFont;
	String XlabelColor;
	String YlabelColor;
	double pchartLeftMargin;
	double pchartTopMargin;
	double pchartLegendMargin;
	double pchartBottomMargin;
	double pchartSecondYAxisMargin;
	String plegendPosition;
	String pSerie;
	public String pSeriesNames[];
	String pSeriesData[];
	String pSeriesMaxData[];
	String pSeriesMinData[];
	String pSeriesCloseData[];
	public DataSerie pSeries[];
	public int pnumSeries;
	boolean plegend;
	String loadedParameters[];
	String loadedValues[];
	int loadedParametersCount;
	public boolean promptForParameters;
	private String dataFile;
	private String SQLparams[];
	private String SQLparamsV[];
	private int SQLparamCount;

	public ChartLoader()
	{
		fileEncoding = "";
		jdbcsource = null;
		parentComponent = null;
		gChart = null;
		paintDirect = true;
		pSeriesNames = new String[50];
		pSeriesData = new String[50];
		pSeriesMaxData = new String[50];
		pSeriesMinData = new String[50];
		pSeriesCloseData = new String[50];
		pSeries = new DataSerie[50];
		pnumSeries = 0;
		loadedParameters = new String[1500];
		loadedValues = new String[1500];
		loadedParametersCount = 0;
		promptForParameters = false;
		dataFile = "";
		SQLparams = new String[10];
		SQLparamsV = new String[10];
		SQLparamCount = 0;
		loadedParametersCount = 0;
	}

	private String getSQLParameterValue(String param)
	{
		for (int i = 0; i < SQLparamCount; i++)
			if (SQLparams[i].compareTo(param) == 0)
				return SQLparamsV[i];

		return null;
	}

	private String repSQLParameters(String s)
	{
		int p1 = s.indexOf("[%");
		if (p1 == -1)
			return s;
		for (int p2 = s.indexOf("]", p1); p1 >= 0 && p2 >= 0 && p2 > p1; p2 = s.indexOf("]", p1))
		{
			String param = s.substring(p1 + 2, p2);
			String value = getSQLParameterValue(param);
			if (value == null)
				if (!promptForParameters);
			if (value != null)
				s = (new StringBuilder()).append(s.substring(0, p1)).append(value).append(s.substring(p2 + 1, s.length())).toString();
			p1 = s.indexOf("[%", p2 + 1);
			if (p1 == -1)
				return s;
		}

		return s;
	}

	public void setSQLParameter(String param, String value)
	{
		for (int i = 0; i < SQLparamCount; i++)
			if (SQLparams[i].compareTo(param) == 0)
			{
				SQLparamsV[i] = value;
				return;
			}

		SQLparams[SQLparamCount] = param;
		SQLparamsV[SQLparamCount] = value;
		SQLparamCount++;
	}

	protected static boolean convertBooleanParam(String s, boolean def)
	{
		if (s.compareTo("") == 0)
			return def;
		if (s.toUpperCase().compareTo("N") == 0)
			return false;
		if (s.toUpperCase().compareTo("NO") == 0)
			return false;
		if (s.toUpperCase().compareTo("0") == 0)
			return false;
		if (s.toUpperCase().compareTo("FALSE") == 0)
			return false;
		if (s.toUpperCase().compareTo("Y") == 0)
			return true;
		if (s.toUpperCase().compareTo("YES") == 0)
			return true;
		if (s.toUpperCase().compareTo("TRUE") == 0)
			return true;
		if (s.toUpperCase().compareTo("1") == 0)
			return true;
		return Boolean.valueOf(s).booleanValue();
		Exception e;
		e;
		return def;
	}

	public boolean getBooleanParam(String Param, boolean def)
	{
		String s = getParameter(Param, "");
		return convertBooleanParam(s, def);
	}

	private String replaceStr(String s, String sub1, String sub2)
	{
		for (int p = s.indexOf(sub1); p >= 0; p = s.indexOf(sub1))
			s = (new StringBuilder()).append(s.substring(0, p)).append(sub2).append(s.substring(p + sub1.length(), s.length())).toString();

		return s;
	}

	protected Date getDateParam(String Param, String def)
	{
		String s;
		s = getParameter(Param, "");
		if (s.compareTo("") == 0)
			s = def;
		if (s.compareTo("") == 0)
			return null;
		SimpleDateFormat df;
		s = replaceStr(s, "/", "-");
		df = new SimpleDateFormat("dd-MM-yyyy");
		if (s.length() > 10)
			df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
		return df.parse(s);
		Exception e;
		e;
		e.printStackTrace();
		return null;
	}

	protected Integer getIntParam(String Param, Integer def)
	{
		String s = getParameter(Param, "");
		if (s.compareTo("") == 0)
			return def;
		return new Integer(s);
		Exception e;
		e;
		return def;
	}

	public Double getDoubleParam(String Param, Double def)
	{
		String s = getParameter(Param, "");
		if (s.compareTo("") == 0)
			return def;
		return new Double(s);
		Exception e;
		e;
		return def;
	}

	private String getStringParam(String Param, String def)
	{
		return getParameter(Param, def);
	}

	private String getParsedValue(String s)
	{
		if (jdbcsource == null)
			return s;
		if (s.indexOf("JDBC:") == 0)
		{
			s = repSQLParameters(s);
			s = jdbcsource.executeQuery(s.substring(5, s.length()));
		}
		return s;
	}

	public String getParameter(String key, String def)
	{
		String v = "";
		for (int i = 0; i < loadedParametersCount; i++)
			if (loadedParameters[i].compareTo(key) == 0)
			{
				v = loadedValues[i];
				if (v.length() == 0)
					return def;
				else
					return getParsedValue(v);
			}

		if (v == null)
			return def;
		if (v.length() == 0)
			return def;
		else
			return v;
	}

	public static ChartColor convertColor(String s)
	{
		return GraphicsProvider.getColor(s);
	}

	protected static ChartFont convertFont(String f)
	{
		String items[];
		int s;
		items = convertList(f, "|");
		if (items == null)
			return null;
		if (items.length < 3)
			return null;
		s = ChartFont.PLAIN;
		if (items[1].compareTo("BOLD") == 0)
			s = ChartFont.BOLD;
		if (items[1].compareTo("ITALIC") == 0)
			s = ChartFont.ITALIC;
		return GraphicsProvider.getFont(items[0], s, (new Integer(items[2])).intValue());
		Exception e;
		e;
		System.out.println((new StringBuilder()).append("Error converting font ").append(f).append(" ").append(e.getMessage()).toString());
		return null;
	}

	protected static String[] convertList(String items)
	{
		return convertList(items, "|");
	}

	protected static String[] convertList(String items, String separator)
	{
		int elements = 1;
		for (int p = items.indexOf(separator); p >= 0; p = items.indexOf(separator, p + 1))
			elements++;

		String itema[] = new String[elements];
		int itemCount = 0;
		for (int p = items.indexOf(separator); p >= 0; p = items.indexOf(separator))
		{
			itema[itemCount++] = items.substring(0, p);
			items = items.substring(p + separator.length(), items.length());
		}

		if (items.compareTo("") != 0)
			itema[itemCount++] = items;
		if (itemCount == 0)
			return null;
		String result[] = new String[itemCount];
		for (int i = 0; i < itemCount; i++)
			result[i] = itema[i];

		return result;
	}

	private String[] getItemsParameter(String key)
	{
		String items = getStringParam(key, "");
		return convertList(items);
	}

	private double[] convertDoubleList(String s)
	{
		String items[] = convertList(s);
		if (items == null)
			return null;
		double d[] = new double[items.length];
		for (int i = 0; i < items.length; i++)
			try
			{
				d[i] = (new Double(items[i])).doubleValue();
			}
			catch (Exception e)
			{
				d[i] = 0.0D;
			}

		return d;
	}

	private int[] convertIntList(String s)
	{
		String items[] = convertList(s);
		int d[] = new int[items.length];
		for (int i = 0; i < items.length; i++)
			try
			{
				d[i] = (new Integer(items[i])).intValue();
			}
			catch (Exception e)
			{
				d[i] = 0;
			}

		return d;
	}

	private Double[] convertDoubleListWithNulls(String s)
	{
		String items[] = convertList(s);
		if (items == null)
			return new Double[0];
		Double d[] = new Double[items.length];
		for (int i = 0; i < items.length; i++)
			try
			{
				if (items[i].toUpperCase().compareTo("NULL") == 0)
					d[i] = null;
				else
					d[i] = new Double(items[i]);
			}
			catch (Exception e)
			{
				d[i] = new Double(0.0D);
			}

		return d;
	}

	private boolean[] convertBooleanList(String s)
	{
		String items[] = convertList(s);
		boolean d[] = new boolean[items.length];
		for (int i = 0; i < items.length; i++)
			try
			{
				d[i] = items[i].compareTo("0") != 0 && items[i].toUpperCase().compareTo("FALSE") != 0;
			}
			catch (Exception e)
			{
				d[i] = false;
			}

		return d;
	}

	protected static LineStyle convertLineStyle(String f)
	{
		return LineStyle.createFromString(f);
	}

	protected static FillStyle convertFillStyle(String f)
	{
		return FillStyle.createFromString(f);
	}

	private String convertFromDates(String v, String dateStep, Date initialDate)
	{
		String vs[] = convertList(v);
		String result = "";
		for (int i = 0; i < vs.length; i++)
		{
			SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
			if (vs[i].length() > 10)
				df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
			Date d = initialDate;
			vs[i] = replaceStr(vs[i], "/", "-");
			try
			{
				d = df.parse(vs[i]);
			}
			catch (Exception e)
			{
				e.printStackTrace();
			}
			double diff2 = Axis.convertFromDate(d, dateStep, initialDate);
			if (i > 0)
				result = (new StringBuilder()).append(result).append("|").toString();
			diff2 = Math.floor(diff2 * 100D) / 100D;
			result = (new StringBuilder()).append(result).append(diff2).toString();
		}

		return result;
	}

	private Axis loadAxisAndScale(String name, int type)
	{
		Scale sc = new Scale();
		if (getBooleanParam((new StringBuilder()).append(name).append("SCALE_LOG").toString(), false))
			sc = new LogScale();
		int iTmp = getIntParam((new StringBuilder()).append(name).append("SCALE_LOG_BASE").toString(), new Integer(2)).intValue();
		if (iTmp != 2 && (sc instanceof LogScale))
			((LogScale)sc).base = iTmp;
		Double scaleMin = getDoubleParam((new StringBuilder()).append(name).append("SCALE_MIN").toString(), null);
		Double scaleMax = getDoubleParam((new StringBuilder()).append(name).append("SCALE_MAX").toString(), null);
		if (scaleMin != null)
			sc.min = scaleMin.doubleValue();
		if (scaleMax != null)
			sc.max = scaleMax.doubleValue();
		boolean bigTicksGrid = getBooleanParam((new StringBuilder()).append("GRID").append(name).toString(), false);
		Double scaleTickInterval = getDoubleParam((new StringBuilder()).append("TICK_INTERVAL").append(name).toString(), new Double(1.0D));
		Integer bigTickInterval = getIntParam((new StringBuilder()).append("BIG_TICK_INTERVAL").append(name).toString(), new Integer(5));
		int bigTickIntervalList[] = null;
		if (getStringParam((new StringBuilder()).append("BIG_TICK_INTERVAL_LIST").append(name).toString(), "").length() > 0)
			bigTickIntervalList = convertIntList(getStringParam((new StringBuilder()).append("BIG_TICK_INTERVAL_LIST").append(name).toString(), ""));
		String axisLabels = getStringParam((new StringBuilder()).append(name).append("AXIS_LABELS").toString(), "");
		sc.exactMaxValue = getBooleanParam((new StringBuilder()).append(name).append("SCALE_EXACT_MAX").toString(), false);
		sc.exactMinValue = getBooleanParam((new StringBuilder()).append(name).append("SCALE_EXACT_MIN").toString(), false);
		if (getStringParam((new StringBuilder()).append(name).append("SCALE_PREF_MAXMIN").toString(), "").length() > 0)
			sc.preferred_MaxMin_values = convertDoubleList(getStringParam((new StringBuilder()).append(name).append("SCALE_PREF_MAXMIN").toString(), ""));
		Axis axis = new Axis(type, sc);
		if (getStringParam((new StringBuilder()).append(name).append("SCALE_INVERTED").toString(), "").length() > 0)
			sc.reverse = getBooleanParam((new StringBuilder()).append(name).append("SCALE_INVERTED").toString(), false);
		axis.bigTickInterval = bigTickInterval.intValue();
		axis.bigTickIntervalList = bigTickIntervalList;
		axis.scaleTickInterval = scaleTickInterval.doubleValue();
		axis.bigTicksGrid = bigTicksGrid;
		if (axisLabels.compareTo("") != 0)
			axis.tickLabels = convertList(axisLabels);
		loadAxis(axis, name);
		for (int subAxis = 1; getBooleanParam((new StringBuilder()).append(name).append("_").append(subAxis).append("AXIS").toString(), false); subAxis++)
			axis.addAdditionalAxis(loadAxisAndScale((new StringBuilder()).append(name).append("_").append(subAxis).toString(), type));

		return axis;
	}

	private void loadAxis(Axis axis, String name)
	{
		axis.autoNumberOfTicks = getIntParam((new StringBuilder()).append(name).append("AXIS_AUTO_TICKS").toString(), new Integer(0)).intValue();
		if (getStringParam((new StringBuilder()).append(name).append("AXIS_PREF_TICK_INTERVAL").toString(), "").length() > 0)
			axis.ticks_preferred_Interval = convertDoubleList(getStringParam((new StringBuilder()).append(name).append("AXIS_PREF_TICK_INTERVAL").toString(), ""));
		if (getBooleanParam((new StringBuilder()).append(name).append("AXIS_START_WITH_BIG_TICK").toString(), false))
			axis.startWithBigTick = true;
		axis.logarithmicIntervals = getBooleanParam((new StringBuilder()).append("TICK_LOG_INTERVAL").append(name).toString(), false);
		axis.axisFrame = getBooleanParam((new StringBuilder()).append(name).append("AXIS_CLOSED").toString(), false);
		axis.xscaleOnTop = getBooleanParam((new StringBuilder()).append(name).append("AXIS_ON_TOP").toString(), false);
		axis.stackAdditionalAxis = getBooleanParam((new StringBuilder()).append(name).append("AXIS_STACK_ADDITIONAL").toString(), false);
		axis.labelTemplate = getStringParam((new StringBuilder()).append(name).append("AXIS_TEMPLATE").toString(), "");
		axis.label = getStringParam((new StringBuilder()).append(name).append("AXIS_LABEL").toString(), "");
		axis.dateLabelFormat = getStringParam((new StringBuilder()).append(name).append("AXIS_DATE_FORMAT").toString(), "dd-MMM-yyyy");
		axis.dateStep = getStringParam((new StringBuilder()).append(name).append("AXIS_DATE_STEP").toString(), "d");
		axis.initialDate = getDateParam((new StringBuilder()).append(name).append("AXIS_INITIAL_DATE").toString(), "");
		Date d = getDateParam((new StringBuilder()).append(name).append("AXIS_FINAL_DATE").toString(), "");
		if (d != null)
		{
			axis.scale.max = Axis.convertFromDate(d, axis.dateStep, axis.initialDate);
			axis.dateStepPerUnit = true;
		}
		axis.tickLabelLength = getIntParam((new StringBuilder()).append(name).append("AXIS_TICK_TEXT_LINE").toString(), new Integer(1000)).intValue();
		axis.tickPixels = (int)getDoubleParam((new StringBuilder()).append(name).append("AXIS_TICKPIXELS").toString(), new Double(axis.tickPixels)).doubleValue();
		axis.bigTickPixels = (int)getDoubleParam((new StringBuilder()).append(name).append("AXIS_BIGTICKPIXELS").toString(), new Double(axis.bigTickPixels)).doubleValue();
		String ceroAxis = getStringParam("CERO_XAXIS", "");
		if (ceroAxis.compareTo("LINE") == 0)
			axis.ceroAxis = 0;
		if (ceroAxis.compareTo("NO") == 0)
			axis.ceroAxis = 1;
		if (ceroAxis.compareTo("SCALE") == 0)
			axis.ceroAxis = 2;
		LineStyle lstyle = convertLineStyle(getStringParam("CERO_XAXIS_STYLE", ""));
		if (lstyle != null)
			axis.ceroAxisStyle = lstyle;
		lstyle = convertLineStyle(getStringParam((new StringBuilder()).append(name).append("AXIS_STYLE").toString(), ""));
		if (lstyle != null)
			axis.style = lstyle;
		lstyle = convertLineStyle(getStringParam((new StringBuilder()).append(name).append("AXIS_GRID").toString(), ""));
		if (lstyle != null)
			axis.gridStyle = lstyle;
		FillStyle fstyle = convertFillStyle(getStringParam((new StringBuilder()).append(name).append("AXIS_FILL_GRID").toString(), ""));
		if (fstyle != null)
			axis.gridFillStyle = fstyle;
		ChartColor c = convertColor(getStringParam((new StringBuilder()).append(name).append("AXIS_FONT_COLOR").toString(), ""));
		axis.DescColor = c;
		ChartFont font = convertFont(getStringParam((new StringBuilder()).append(name).append("AXIS_FONT").toString(), ""));
		if (font != null)
			axis.DescFont = font;
		axis.IntegerScale = getBooleanParam((new StringBuilder()).append(name).append("AXIS_INTEGER").toString(), true);
		axis.scaleLabelFormat = getStringParam((new StringBuilder()).append(name).append("AXIS_LABEL_FORMAT").toString(), "");
		axis.tickAtBase = getBooleanParam((new StringBuilder()).append(name).append("AXIS_TICKATBASE").toString(), false);
		axis.rotateLabels = getIntParam((new StringBuilder()).append(name).append("AXIS_ROTATE_LABELS").toString(), new Integer(0)).intValue();
		if (getBooleanParam((new StringBuilder()).append(name).append("AXIS_VERTICAL_LABELS").toString(), false))
			axis.rotateLabels = 90;
		fstyle = convertFillStyle(getStringParam((new StringBuilder()).append(name).append("AXIS_FILLING").toString(), ""));
		if (fstyle != null)
			axis.barFilling = fstyle;
		String tmp = getStringParam((new StringBuilder()).append(name).append("AXIS_BAR_STYLE").toString(), "NONE");
		if (tmp.equals("BAR"))
			axis.barStyle = 1;
		if (tmp.equals("RAISED"))
			axis.barStyle = 2;
		axis.barWidth = getIntParam((new StringBuilder()).append(name).append("AXIS_BAR_WIDTH").toString(), new Integer(axis.barWidth)).intValue();
		for (int zoneNr = 1; getParameter((new StringBuilder()).append(name).append("AXIS_TARGET_ZONE_").append(zoneNr).toString(), "").length() > 0; zoneNr++)
			axis.addTargetZone(AxisTargetZone.createFromString(getParameter((new StringBuilder()).append(name).append("AXIS_TARGET_ZONE_").append(zoneNr).toString(), "")));

	}

	private void setAxisForSerie(int i, Axis cXAxis, Axis cYAxis, DataSerie s)
	{
		int secAxis = getIntParam((new StringBuilder()).append("SERIE_SECONDARY_XAXIS_").append(i).toString(), new Integer(0)).intValue();
		if (secAxis > 0 && cXAxis.getAdditionalAxisCount() >= secAxis)
			s.secondaryXAxis = cXAxis.getAdditionalAxis(secAxis - 1);
		secAxis = getIntParam((new StringBuilder()).append("SERIE_SECONDARY_YAXIS_").append(i).toString(), new Integer(0)).intValue();
		if (secAxis > 0 && cYAxis.getAdditionalAxisCount() >= secAxis)
			s.secondaryYAxis = cYAxis.getAdditionalAxis(secAxis - 1);
	}

	private Chart buildChart(Chart currentChart)
	{
		ChartFont font = null;
		Title cTitle = null;
		HAxisLabel cXLabel = null;
		VAxisLabel cYLabel = null;
		VAxisLabel cY2Label = null;
		GaugePlotter gaugePlot = null;
		LinePlotter linePlot = null;
		LinePlotter3D linePlot3D = null;
		BarPlotter barPlot = null;
		BarPlotter3D barPlot3D = null;
		PiePlotter piePlot = null;
		RadarPlotter radarPlot = null;
		String jdbcdb = "";
		String jdbcdriver = "";
		String jdbcuser = "";
		String jdbcpwd = "";
		Axis cXAxis = null;
		Axis cYAxis = null;
		Axis cY2Axis = null;
		Legend clegend = new Legend();
		jdbcdb = getStringParam("JDBC_DATABASE", "");
		jdbcdriver = getStringParam("JDBC_DRIVER", "");
		jdbcuser = getStringParam("JDBC_USER", "");
		jdbcpwd = getStringParam("JDBC_PASSWORD", "");
		if (jdbcdb.length() > 0)
		{
			jdbcsource = new JDBCSource();
			jdbcsource.open(jdbcdb, jdbcdriver, jdbcuser, jdbcpwd);
		}
		LineDataSerie.startingXValue = getIntParam("LINECHART_START_VALUE_X", new Integer(0)).intValue();
		ptitle = getStringParam("TITLECHART", "");
		if (ptitle.compareTo("") == 0)
			ptitle = getStringParam("TITLE", "");
		if (ptitle.compareTo("") != 0)
		{
			cTitle = new Title(ptitle);
			ptitleFont = getStringParam("TITLE_FONT", "");
			font = convertFont(ptitleFont);
			if (font != null)
				cTitle.font = font;
			ptitleColor = getStringParam("TITLE_COLOR", "");
			if (ptitleColor != null)
				cTitle.color = convertColor(ptitleColor);
		}
		Xlabel = getStringParam("XLABEL", "");
		ChartColor c;
		if (Xlabel.compareTo("") != 0)
		{
			XlabelFont = getStringParam("XLABEL_FONT", "");
			font = convertFont(XlabelFont);
			if (font == null)
				font = GraphicsProvider.getFont("Arial", ChartFont.BOLD, 12);
			XlabelColor = getStringParam("XLABEL_COLOR", "");
			if (XlabelColor != null)
				c = convertColor(XlabelColor);
			else
				c = GraphicsProvider.getColor(ChartColor.BLACK);
			cXLabel = new HAxisLabel(Xlabel, c, font);
			cXLabel.vertical = getBooleanParam("XLABEL_VERTICAL", false);
		}
		Ylabel = getStringParam("YLABEL", "");
		if (Ylabel.compareTo("") != 0)
		{
			YlabelFont = getStringParam("YLABEL_FONT", "");
			font = convertFont(YlabelFont);
			if (font == null)
				font = GraphicsProvider.getFont("Arial", ChartFont.BOLD, 12);
			YlabelColor = getStringParam("YLABEL_COLOR", "");
			if (YlabelColor != null)
				c = convertColor(YlabelColor);
			else
				c = GraphicsProvider.getColor(ChartColor.BLACK);
			cYLabel = new VAxisLabel(Ylabel, c, font);
			cYLabel.vertical = getBooleanParam("YLABEL_VERTICAL", false);
		}
		Y2label = getStringParam("Y2LABEL", "");
		if (Y2label.compareTo("") != 0)
		{
			Y2labelFont = getStringParam("Y2LABEL_FONT", "");
			font = convertFont(Y2labelFont);
			if (font == null)
				font = GraphicsProvider.getFont("Arial", ChartFont.BOLD, 12);
			Y2labelColor = getStringParam("Y2LABEL_COLOR", "");
			if (Y2labelColor != null)
				c = convertColor(Y2labelColor);
			else
				c = GraphicsProvider.getColor(ChartColor.BLACK);
			cY2Label = new VAxisLabel(Y2label, c, font);
			cY2Label.vertical = getBooleanParam("Y2LABEL_VERTICAL", false);
		}
		boolean axisX = getBooleanParam("XAXIS", true);
		boolean axisY = getBooleanParam("YAXIS", true);
		boolean axisY2 = getBooleanParam("Y2AXIS", false);
		if (axisX)
			cXAxis = loadAxisAndScale("X", 0);
		if (axisY)
			cYAxis = loadAxisAndScale("Y", 1);
		if (axisY2)
			cY2Axis = loadAxisAndScale("Y2", 1);
		FillStyle fstyle = convertFillStyle(getStringParam("LEGEND_FILL", ""));
		if (fstyle != null)
			clegend.background = fstyle;
		LineStyle lstyle = convertLineStyle(getStringParam("LEGEND_BORDER", ""));
		if (lstyle != null)
			clegend.border = lstyle;
		c = convertColor(getStringParam("LEGEND_COLOR", ""));
		clegend.color = c;
		font = convertFont(getStringParam("LEGEND_FONT", ""));
		if (font != null)
			clegend.font = font;
		clegend.verticalLayout = getBooleanParam("LEGEND_VERTICAL", true);
		clegend.legendLabel = getStringParam("LEGEND_LABEL", "");
		pnumSeries = 0;
		for (int i = 1; i < 50; i++)
		{
			pSerie = getStringParam((new StringBuilder()).append("SERIE_").append(i).toString(), "");
			if (pSerie.compareTo("") == 0)
				break;
			pSeriesNames[i] = pSerie;
			pSeriesData[i] = getStringParam((new StringBuilder()).append("SERIE_DATA_").append(i).toString(), "");
			if (pSeriesData[i].indexOf("/") > 0)
				pSeriesData[i] = convertFromDates(pSeriesData[i], cYAxis.dateStep, cYAxis.initialDate);
			String Typ = getStringParam((new StringBuilder()).append("SERIE_TYPE_").append(i).toString(), "LINE");
			pSeries[i] = null;
			if (Typ.compareTo("LINE") == 0 || Typ.compareTo("B-SPLINES") == 0 || Typ.compareTo("CURVE") == 0 || Typ.compareTo("LINE_LEAST_SQUARES") == 0)
			{
				if (linePlot == null)
				{
					if (Typ.compareTo("LINE") == 0)
						linePlot = new LinePlotter();
					else
						linePlot = new CurvePlotter();
					linePlot.XScale = cXAxis.scale;
					linePlot.YScale = cYAxis.scale;
					if (cY2Axis != null)
						linePlot.Y2Scale = cY2Axis.scale;
					linePlot.fixedLimits = getBooleanParam("LINECHART_FIXED_LIMITS", false);
					linePlot.pointSize = getIntParam("LINECHART_POINT_SIZE", new Integer(6)).intValue();
					FillStyle backstyle = convertFillStyle(getStringParam("LINECHART_BACK", ""));
					if (backstyle != null)
						linePlot.back = backstyle;
				}
				lstyle = convertLineStyle(getStringParam((new StringBuilder()).append("SERIE_STYLE_").append(i).toString(), ""));
				if (lstyle == null)
					lstyle = new LineStyle(0.2F, GraphicsProvider.getColor(ChartColor.BLACK), 1);
				LineStyle vstyle = convertLineStyle(getStringParam((new StringBuilder()).append("SERIE_V_STYLE_").append(i).toString(), ""));
				if (!getBooleanParam((new StringBuilder()).append("SERIE_DRAW_LINE_").append(i).toString(), true))
					lstyle = null;
				pSeriesMaxData[i] = getStringParam((new StringBuilder()).append("SERIE_MAX_DATA_").append(i).toString(), "");
				pSeriesMaxData[i] = getStringParam((new StringBuilder()).append("SERIE_MAX_DATA_").append(i).toString(), "");
				pSeriesMinData[i] = getStringParam((new StringBuilder()).append("SERIE_MIN_DATA_").append(i).toString(), "");
				pSeriesCloseData[i] = getStringParam((new StringBuilder()).append("SERIE_CLOSE_DATA_").append(i).toString(), "");
				pSeries[i] = null;
				if (pSeriesMaxData[i].length() == 0)
				{
					pSeries[i] = new LineDataSerie(convertDoubleListWithNulls(pSeriesData[i]), lstyle);
					((LineDataSerie)pSeries[i]).vstyle = vstyle;
				}
				if (pSeriesMaxData[i].length() > 0 && pSeriesCloseData[i].length() == 0)
				{
					pSeries[i] = new MaxMinDataSerie(convertDoubleListWithNulls(pSeriesData[i]), lstyle);
					if (pSeriesMinData[i].length() > 0)
						((MaxMinDataSerie)pSeries[i]).setMaxMinValues(convertDoubleList(pSeriesMaxData[i]), convertDoubleList(pSeriesMinData[i]));
					else
						((MaxMinDataSerie)pSeries[i]).setMaxMinValues(convertDoubleList(pSeriesMaxData[i]), null);
					((MaxMinDataSerie)pSeries[i]).drawLineEnd = getStringParam((new StringBuilder()).append("SERIE_LINE_END_").append(i).toString(), "").toUpperCase().compareTo("TRUE") == 0;
					linePlot.MaxMinType = 0;
					LineStyle mmstyle = convertLineStyle(getStringParam((new StringBuilder()).append("SERIE_MAXMIN_STYLE_").append(i).toString(), ""));
					if (mmstyle != null)
						((MaxMinDataSerie)pSeries[i]).maxminStyle = mmstyle;
					if (getStringParam((new StringBuilder()).append("SERIE_BUBBLE_").append(i).toString(), "").toUpperCase().compareTo("TRUE") == 0)
					{
						((MaxMinDataSerie)pSeries[i]).bubbleChart = true;
						if (getStringParam((new StringBuilder()).append("SERIE_FILL_BUBBLE_").append(i).toString(), "").toUpperCase().compareTo("TRUE") == 0)
							((MaxMinDataSerie)pSeries[i]).fillBubble = true;
						else
							((MaxMinDataSerie)pSeries[i]).fillBubble = false;
					}
				}
				if (pSeriesMaxData[i].length() > 0 && pSeriesCloseData[i].length() > 0)
				{
					pSeries[i] = new MaxMinDataSerie(convertDoubleListWithNulls(pSeriesData[i]), convertDoubleList(pSeriesCloseData[i]), convertDoubleList(pSeriesMaxData[i]), convertDoubleList(pSeriesMinData[i]), lstyle);
					linePlot.MaxMinType = 1;
					((MaxMinDataSerie)pSeries[i]).drawLineEnd = getStringParam((new StringBuilder()).append("SERIE_LINE_END_").append(i).toString(), "").toUpperCase().compareTo("TRUE") == 0;
					if (getStringParam((new StringBuilder()).append("SERIE_LINE_TYPE_").append(i).toString(), "").compareTo("CANDLESTICK") == 0)
						linePlot.MaxMinType = 2;
					if (getStringParam((new StringBuilder()).append("SERIE_CANDLE_POSITIVE_COLOR_").append(i).toString(), "").length() > 0)
						((MaxMinDataSerie)pSeries[i]).positiveValueColor = convertColor(getStringParam((new StringBuilder()).append("SERIE_CANDLE_POSITIVE_COLOR_").append(i).toString(), ""));
					if (getStringParam((new StringBuilder()).append("SERIE_CANDLE_NEGATIVE_COLOR_").append(i).toString(), "").length() > 0)
						((MaxMinDataSerie)pSeries[i]).negativeValueColor = convertColor(getStringParam((new StringBuilder()).append("SERIE_CANDLE_NEGATIVE_COLOR_").append(i).toString(), ""));
					((MaxMinDataSerie)pSeries[i]).openCloseWidth = getIntParam((new StringBuilder()).append("SERIE_OPENCLOSE_WIDTH_").append(i).toString(), new Integer(7)).intValue();
					LineStyle mmstyle = convertLineStyle(getStringParam((new StringBuilder()).append("SERIE_MAXMIN_STYLE_").append(i).toString(), ""));
					if (mmstyle != null)
						((MaxMinDataSerie)pSeries[i]).maxminStyle = mmstyle;
				}
				if (Typ.compareTo("LINE") == 0)
					((LineDataSerie)pSeries[i]).lineType = 0;
				if (Typ.compareTo("B-SPLINES") == 0)
					((LineDataSerie)pSeries[i]).lineType = 2;
				if (Typ.compareTo("CURVE") == 0)
					((LineDataSerie)pSeries[i]).lineType = 1;
				if (Typ.compareTo("LINE_LEAST_SQUARES") == 0)
					((LineDataSerie)pSeries[i]).lineType = 3;
				String Xs = getStringParam((new StringBuilder()).append("SERIE_DATAX_").append(i).toString(), "");
				if (Xs.length() > 0)
				{
					if (Xs.indexOf("/") > 0)
						Xs = convertFromDates(Xs, cXAxis.dateStep, cXAxis.initialDate);
					pSeries[i].setDatax(convertDoubleList(Xs));
				}
				pSeries[i].secondYAxis = getBooleanParam((new StringBuilder()).append("SERIE_SECONDYAXIS_").append(i).toString(), false);
				setAxisForSerie(i, cXAxis, cYAxis, pSeries[i]);
				fstyle = convertFillStyle(getStringParam((new StringBuilder()).append("SERIE_FILL_").append(i).toString(), ""));
				if (fstyle != null)
					((LineDataSerie)pSeries[i]).fillStyle = fstyle;
				font = convertFont(getStringParam((new StringBuilder()).append("SERIE_FONT_").append(i).toString(), ""));
				if (font != null)
					((LineDataSerie)pSeries[i]).valueFont = font;
				c = convertColor(getStringParam((new StringBuilder()).append("SERIE_COLOR_").append(i).toString(), ""));
				((LineDataSerie)pSeries[i]).valueColor = c;
				c = convertColor(getStringParam((new StringBuilder()).append("SERIE_POINT_COLOR_").append(i).toString(), ""));
				((LineDataSerie)pSeries[i]).pointColor = c;
				((LineDataSerie)pSeries[i]).drawPoint = getBooleanParam((new StringBuilder()).append("SERIE_POINT_").append(i).toString(), false);
				com.java4less.rchart.gc.ChartImage im2 = null;
				String pointImageStr = getStringParam((new StringBuilder()).append("SERIE_POINT_IMAGE_").append(i).toString(), "");
				if (pointImageStr.compareTo("") != 0)
				{
					im2 = GraphicsProvider.getImage(pointImageStr);
					((LineDataSerie)pSeries[i]).icon = im2;
				}
				if (!pSeriesNames[i].startsWith("HIDDEN"))
					if (im2 != null)
						clegend.addItem(pSeriesNames[i], im2);
					else
					if (fstyle == null)
					{
						if (lstyle != null)
							clegend.addItem(pSeriesNames[i], lstyle);
						else
							clegend.addItem(pSeriesNames[i], new FillStyle(((LineDataSerie)pSeries[i]).valueColor));
					} else
					{
						clegend.addItem(pSeriesNames[i], fstyle);
					}
				pSeries[i].name = pSeriesNames[i];
				linePlot.addSerie(pSeries[i]);
			}
			if (Typ.compareTo("LINE3D") == 0)
			{
				if (linePlot3D == null)
				{
					linePlot3D = new LinePlotter3D();
					linePlot3D.XScale = cXAxis.scale;
					linePlot3D.YScale = cYAxis.scale;
					if (cY2Axis != null)
						linePlot3D.Y2Scale = cY2Axis.scale;
					linePlot3D.fixedLimits = getBooleanParam("LINECHART_FIXED_LIMITS", false);
					if (getStringParam("LINECHART3D_BORDER", "").length() > 0)
						linePlot3D.border = convertLineStyle(getStringParam("LINECHART3D_BORDER", ""));
					if (getStringParam("LINECHART3D_DEPTH", "").length() > 0)
						linePlot3D.depth = (int)getDoubleParam("LINECHART3D_DEPTH", new Double(20D)).doubleValue();
					if (getStringParam("LINECHART3D_SEPARATOR", "").length() > 0)
						linePlot3D.interLineSpace = (int)getDoubleParam("LINECHART3D_SEPARATOR", new Double(0.0D)).doubleValue();
					FillStyle backstyle = convertFillStyle(getStringParam("LINECHART3D_BACK", ""));
					if (backstyle != null)
						linePlot3D.back = backstyle;
				}
				lstyle = convertLineStyle(getStringParam((new StringBuilder()).append("SERIE_STYLE_").append(i).toString(), ""));
				if (lstyle == null)
					lstyle = new LineStyle(0.2F, GraphicsProvider.getColor(ChartColor.BLACK), 1);
				if (getStringParam((new StringBuilder()).append("SERIE_DRAW_LINE_").append(i).toString(), "").compareTo("N") == 0)
					lstyle = null;
				pSeries[i] = new LineDataSerie(convertDoubleListWithNulls(pSeriesData[i]), lstyle);
				String Xs = getStringParam((new StringBuilder()).append("SERIE_DATAX_").append(i).toString(), "");
				if (Xs.length() > 0)
					pSeries[i].setDatax(convertDoubleList(Xs));
				pSeries[i].secondYAxis = getBooleanParam((new StringBuilder()).append("SERIE_SECONDYAXIS_").append(i).toString(), false);
				setAxisForSerie(i, cXAxis, cYAxis, pSeries[i]);
				fstyle = convertFillStyle(getStringParam((new StringBuilder()).append("SERIE_FILL_").append(i).toString(), ""));
				if (fstyle != null)
					((LineDataSerie)pSeries[i]).fillStyle = fstyle;
				font = convertFont(getStringParam((new StringBuilder()).append("SERIE_FONT_").append(i).toString(), ""));
				if (font != null)
					((LineDataSerie)pSeries[i]).valueFont = font;
				c = convertColor(getStringParam((new StringBuilder()).append("SERIE_COLOR_").append(i).toString(), ""));
				((LineDataSerie)pSeries[i]).valueColor = c;
				com.java4less.rchart.gc.ChartImage im2 = null;
				String pointImageStr = getStringParam((new StringBuilder()).append("SERIE_POINT_IMAGE_").append(i).toString(), "");
				if (pointImageStr.compareTo("") != 0)
				{
					im2 = GraphicsProvider.getImage(pointImageStr);
					((LineDataSerie)pSeries[i]).icon = im2;
				}
				if (im2 != null)
					clegend.addItem(pSeriesNames[i], im2);
				else
				if (fstyle == null)
				{
					if (lstyle != null)
						clegend.addItem(pSeriesNames[i], lstyle);
					else
						clegend.addItem(pSeriesNames[i], new FillStyle(((LineDataSerie)pSeries[i]).valueColor));
				} else
				{
					clegend.addItem(pSeriesNames[i], fstyle);
				}
				pSeries[i].name = pSeriesNames[i];
				linePlot3D.addSerie(pSeries[i]);
			}
			if (Typ.compareTo("RADAR") == 0)
			{
				if (radarPlot == null)
					radarPlot = new RadarPlotter();
				lstyle = convertLineStyle(getStringParam((new StringBuilder()).append("SERIE_STYLE_").append(i).toString(), ""));
				if (lstyle == null)
					lstyle = new LineStyle(0.2F, GraphicsProvider.getColor(ChartColor.BLACK), 1);
				pSeries[i] = null;
				pSeries[i] = new LineDataSerie(convertDoubleList(pSeriesData[i]), lstyle);
				fstyle = convertFillStyle(getStringParam((new StringBuilder()).append("SERIE_FILL_").append(i).toString(), ""));
				if (fstyle != null)
					((LineDataSerie)pSeries[i]).fillStyle = fstyle;
				if (fstyle == null)
					clegend.addItem(pSeriesNames[i], lstyle);
				else
					clegend.addItem(pSeriesNames[i], fstyle);
				font = convertFont(getStringParam((new StringBuilder()).append("SERIE_FONT_").append(i).toString(), ""));
				if (font != null)
					((LineDataSerie)pSeries[i]).valueFont = font;
				c = convertColor(getStringParam((new StringBuilder()).append("SERIE_COLOR_").append(i).toString(), ""));
				((LineDataSerie)pSeries[i]).valueColor = c;
				c = convertColor(getStringParam((new StringBuilder()).append("SERIE_POINT_COLOR_").append(i).toString(), ""));
				((LineDataSerie)pSeries[i]).pointColor = c;
				((LineDataSerie)pSeries[i]).drawPoint = getBooleanParam((new StringBuilder()).append("SERIE_POINT_").append(i).toString(), false);
				pSeries[i].name = pSeriesNames[i];
				radarPlot.addSerie(pSeries[i]);
			}
			if (Typ.compareTo("BAR3D") == 0)
			{
				fstyle = convertFillStyle(getStringParam((new StringBuilder()).append("SERIE_STYLE_").append(i).toString(), ""));
				if (fstyle == null)
					fstyle = convertFillStyle(getStringParam((new StringBuilder()).append("SERIE_BAR_STYLE_").append(i).toString(), ""));
				if (fstyle == null)
					fstyle = new FillStyle(GraphicsProvider.getColor(ChartColor.BLUE));
				pSeries[i] = new BarDataSerie(convertDoubleList(pSeriesData[i]), fstyle);
				((BarDataSerie)pSeries[i]).addBarsBase(convertDoubleList(getStringParam((new StringBuilder()).append("SERIE_BARS_START_").append(i).toString(), "")));
				String Xs = getStringParam((new StringBuilder()).append("SERIE_DATAX_").append(i).toString(), "");
				if (Xs.length() > 0)
					pSeries[i].setDatax(convertDoubleList(Xs));
				if (getStringParam((new StringBuilder()).append("SERIE_NEGATIVE_STYLE_").append(i).toString(), "").length() > 0)
					((BarDataSerie)pSeries[i]).negativeStyle = convertFillStyle(getStringParam((new StringBuilder()).append("SERIE_NEGATIVE_STYLE_").append(i).toString(), ""));
				clegend.addItem(pSeriesNames[i], fstyle);
				if (getStringParam((new StringBuilder()).append("SERIE_BARS_COLORS_").append(i).toString(), "").length() > 0)
				{
					String listTMP[] = convertList(getStringParam((new StringBuilder()).append("SERIE_BARS_COLORS_").append(i).toString(), ""));
					((BarDataSerie)pSeries[i]).barStyles = new FillStyle[listTMP.length];
					for (int j = 0; j < listTMP.length; j++)
						((BarDataSerie)pSeries[i]).barStyles[j] = new FillStyle(convertColor(listTMP[j]));

				}
				font = convertFont(getStringParam((new StringBuilder()).append("SERIE_FONT_").append(i).toString(), ""));
				if (font != null)
					((BarDataSerie)pSeries[i]).valueFont = font;
				c = convertColor(getStringParam((new StringBuilder()).append("SERIE_COLOR_").append(i).toString(), ""));
				((BarDataSerie)pSeries[i]).valueColor = c;
				pSeries[i].secondYAxis = getBooleanParam((new StringBuilder()).append("SERIE_SECONDYAXIS_").append(i).toString(), false);
				setAxisForSerie(i, cXAxis, cYAxis, pSeries[i]);
				String t = getStringParam((new StringBuilder()).append("SERIE_BORDER_TYPE_").append(i).toString(), "");
				if (t.compareTo("LOWERED") == 0)
					((BarDataSerie)pSeries[i]).borderType = 1;
				if (t.compareTo("RAISED") == 0)
					((BarDataSerie)pSeries[i]).borderType = 2;
				if (t.compareTo("NO") == 0)
					((BarDataSerie)pSeries[i]).borderType = 3;
				if (t.compareTo("NORMAL") == 0)
					((BarDataSerie)pSeries[i]).borderType = 0;
				lstyle = convertLineStyle(getStringParam((new StringBuilder()).append("SERIE_BORDER_").append(i).toString(), ""));
				if (lstyle != null)
					((BarDataSerie)pSeries[i]).border = lstyle;
				if (barPlot3D == null)
				{
					barPlot3D = new BarPlotter3D();
					barPlot3D.XScale = cXAxis.scale;
					barPlot3D.YScale = cYAxis.scale;
					barPlot3D.barAtAxis = getBooleanParam("BARCHART_BAR_AT_AXIS", false);
					if (cY2Axis != null)
						barPlot3D.Y2Scale = cY2Axis.scale;
					if (getStringParam("BARCHART3D_DEPTH", "").length() > 0)
						barPlot3D.depth = (int)getDoubleParam("BARCHART3D_DEPTH", new Double(20D)).doubleValue();
					barPlot3D.fullDepth = getStringParam("BARCHART3D_FULL_DEPTH", "").toUpperCase().compareTo("TRUE") == 0;
					FillStyle backstyle = convertFillStyle(getStringParam("BARCHART3D_BACK", ""));
					if (backstyle != null)
						barPlot3D.back = backstyle;
					barPlot3D.cumulative = getBooleanParam("BARCHART_CUMULATIVE", false);
				}
				barPlot3D.verticalBars = getBooleanParam("BARCHART_VERTICAL", true);
				pSeries[i].name = pSeriesNames[i];
				barPlot3D.addSerie(pSeries[i]);
			}
			if (Typ.compareTo("BAR") == 0)
			{
				fstyle = convertFillStyle(getStringParam((new StringBuilder()).append("SERIE_STYLE_").append(i).toString(), ""));
				if (fstyle == null)
					fstyle = convertFillStyle(getStringParam((new StringBuilder()).append("SERIE_BAR_STYLE_").append(i).toString(), ""));
				if (fstyle == null)
					fstyle = new FillStyle(GraphicsProvider.getColor(ChartColor.BLUE));
				pSeries[i] = new BarDataSerie(convertDoubleList(pSeriesData[i]), fstyle);
				((BarDataSerie)pSeries[i]).addBarsBase(convertDoubleList(getStringParam((new StringBuilder()).append("SERIE_BARS_START_").append(i).toString(), "")));
				String Xs = getStringParam((new StringBuilder()).append("SERIE_DATAX_").append(i).toString(), "");
				if (Xs.length() > 0)
					pSeries[i].setDatax(convertDoubleList(Xs));
				if (getStringParam((new StringBuilder()).append("SERIE_NEGATIVE_STYLE_").append(i).toString(), "").length() > 0)
					((BarDataSerie)pSeries[i]).negativeStyle = convertFillStyle(getStringParam((new StringBuilder()).append("SERIE_NEGATIVE_STYLE_").append(i).toString(), ""));
				clegend.addItem(pSeriesNames[i], fstyle);
				if (getStringParam((new StringBuilder()).append("SERIE_BARS_COLORS_").append(i).toString(), "").length() > 0)
				{
					String listTMP[] = convertList(getStringParam((new StringBuilder()).append("SERIE_BARS_COLORS_").append(i).toString(), ""));
					((BarDataSerie)pSeries[i]).barStyles = new FillStyle[listTMP.length];
					for (int j = 0; j < listTMP.length; j++)
						((BarDataSerie)pSeries[i]).barStyles[j] = new FillStyle(convertColor(listTMP[j]));

				}
				font = convertFont(getStringParam((new StringBuilder()).append("SERIE_FONT_").append(i).toString(), ""));
				if (font != null)
					((BarDataSerie)pSeries[i]).valueFont = font;
				c = convertColor(getStringParam((new StringBuilder()).append("SERIE_COLOR_").append(i).toString(), ""));
				((BarDataSerie)pSeries[i]).valueColor = c;
				pSeries[i].secondYAxis = getBooleanParam((new StringBuilder()).append("SERIE_SECONDYAXIS_").append(i).toString(), false);
				setAxisForSerie(i, cXAxis, cYAxis, pSeries[i]);
				String t = getStringParam((new StringBuilder()).append("SERIE_BORDER_TYPE_").append(i).toString(), "");
				if (t.compareTo("LOWERED") == 0)
					((BarDataSerie)pSeries[i]).borderType = 1;
				if (t.compareTo("RAISED") == 0)
					((BarDataSerie)pSeries[i]).borderType = 2;
				if (t.compareTo("NO") == 0)
					((BarDataSerie)pSeries[i]).borderType = 3;
				if (t.compareTo("NORMAL") == 0)
					((BarDataSerie)pSeries[i]).borderType = 0;
				lstyle = convertLineStyle(getStringParam((new StringBuilder()).append("SERIE_BORDER_").append(i).toString(), ""));
				if (lstyle != null)
					((BarDataSerie)pSeries[i]).border = lstyle;
				if (barPlot == null)
				{
					barPlot = new BarPlotter();
					barPlot.XScale = cXAxis.scale;
					barPlot.YScale = cYAxis.scale;
					if (cY2Axis != null)
						barPlot.Y2Scale = cY2Axis.scale;
					barPlot.barAtAxis = getBooleanParam("BARCHART_BAR_AT_AXIS", false);
					FillStyle backstyle = convertFillStyle(getStringParam("BARCHART_BACK", ""));
					if (backstyle != null)
						barPlot.back = backstyle;
					barPlot.cumulative = getBooleanParam("BARCHART_CUMULATIVE", false);
					if (getBooleanParam("BARCHART_CUMULATIVE_BACK_COMPATIBLE", false))
						barPlot.cumulativeBackwardsCompatible = true;
					barPlot.eventChart = getBooleanParam("BARCHART_EVENTCHART", false);
				}
				barPlot.verticalBars = getBooleanParam("BARCHART_VERTICAL", true);
				pSeries[i].name = pSeriesNames[i];
				barPlot.addSerie(pSeries[i]);
			}
			if (Typ.compareTo("PIE") == 0 && pSeriesData[i].length() > 0)
			{
				FillStyle styles[] = new FillStyle[50];
				int j = 1;
				do
				{
					if (j >= 50)
						break;
					fstyle = convertFillStyle(getStringParam((new StringBuilder()).append("PIE_STYLE_").append(j).toString(), ""));
					if (fstyle == null)
						break;
					styles[j - 1] = fstyle;
					clegend.addItem(getStringParam((new StringBuilder()).append("PIE_NAME_").append(j).toString(), ""), fstyle);
					j++;
				} while (true);
				boolean pieKeepTogether[] = null;
				String pieLabels[] = null;
				if (getStringParam((new StringBuilder()).append("SERIE_LABELS_").append(i).toString(), "").length() > 0)
					pieLabels = getItemsParameter((new StringBuilder()).append("SERIE_LABELS_").append(i).toString());
				if (getStringParam((new StringBuilder()).append("SERIE_TOGETHER_").append(i).toString(), "").length() > 0)
					pieKeepTogether = convertBooleanList(getStringParam((new StringBuilder()).append("SERIE_TOGETHER_").append(i).toString(), ""));
				pSeries[i] = new PieDataSerie(convertDoubleList(pSeriesData[i]), styles, pieKeepTogether, pieLabels);
				font = convertFont(getStringParam((new StringBuilder()).append("SERIE_FONT_").append(i).toString(), ""));
				if (font != null)
					((PieDataSerie)pSeries[i]).valueFont = font;
				if (getStringParam((new StringBuilder()).append("SERIE_FONT_").append(i).toString(), "").compareTo("NULL") == 0)
					((PieDataSerie)pSeries[i]).valueFont = null;
				c = convertColor(getStringParam((new StringBuilder()).append("SERIE_COLOR_").append(i).toString(), ""));
				((PieDataSerie)pSeries[i]).valueColor = c;
				((PieDataSerie)pSeries[i]).drawPercentages = getBooleanParam((new StringBuilder()).append("SERIE_PERCENTAGES_").append(i).toString(), true);
				Double d = getDoubleParam((new StringBuilder()).append("SERIE_DISTCENTER_").append(i).toString(), null);
				if (d != null)
					((PieDataSerie)pSeries[i]).textDistanceToCenter = d.doubleValue();
				if (piePlot == null)
				{
					piePlot = new PiePlotter();
					piePlot.labelFormat = getStringParam("PIE_LABEL_FORMAT", "");
				}
				pSeries[i].name = pSeriesNames[i];
				piePlot.addSerie(pSeries[i]);
			}
			if (Typ.compareTo("GAUGE") == 0)
			{
				if (pSeriesData[i].compareTo("") == 0)
					break;
				FillStyle styles[] = new FillStyle[50];
				int j = 1;
				do
				{
					if (j >= 50)
						break;
					fstyle = convertFillStyle(getStringParam((new StringBuilder()).append("GAUGE_NEEDLE_STYLE_").append(j).toString(), ""));
					if (fstyle == null)
						break;
					styles[j - 1] = fstyle;
					clegend.addItem(getStringParam((new StringBuilder()).append("GAUGE_NEEDLE_").append(j).toString(), ""), fstyle);
					j++;
				} while (true);
				pSeries[i] = new GaugeDataSerie(convertDoubleList(pSeriesData[i]), styles);
				font = convertFont(getStringParam((new StringBuilder()).append("SERIE_FONT_").append(i).toString(), ""));
				if (font != null)
					((GaugeDataSerie)pSeries[i]).valueFont = font;
				if (getStringParam((new StringBuilder()).append("SERIE_FONT_").append(i).toString(), "").compareTo("NULL") == 0)
					((GaugeDataSerie)pSeries[i]).valueFont = null;
				c = convertColor(getStringParam((new StringBuilder()).append("SERIE_COLOR_").append(i).toString(), ""));
				((GaugeDataSerie)pSeries[i]).valueColor = c;
				lstyle = convertLineStyle(getStringParam((new StringBuilder()).append("SERIE_NEEDLE_STYLE_").append(i).toString(), ""));
				if (lstyle == null)
					lstyle = new LineStyle(2.0F, GraphicsProvider.getColor(ChartColor.BLACK), 1);
				((GaugeDataSerie)pSeries[i]).needleStyle = lstyle;
				((GaugeDataSerie)pSeries[i]).needleLength = getIntParam((new StringBuilder()).append("SERIE_NEEDLE_LENTGH_").append(i).toString(), new Integer(80)).intValue();
				if (gaugePlot == null)
					gaugePlot = new GaugePlotter();
				pSeries[i].name = pSeriesNames[i];
				gaugePlot.addSerie(pSeries[i]);
			}
			if (pSeries[i] == null)
				continue;
			pSeries[i].valueFormat = getStringParam((new StringBuilder()).append("SERIE_FORMAT_").append(i).toString(), "#####.##");
			pSeries[i].labelTemplate = getStringParam((new StringBuilder()).append("SERIE_LABEL_TEMPLATE_").append(i).toString(), "");
			pSeries[i].tips = convertList(getStringParam((new StringBuilder()).append("SERIE_TIPS_").append(i).toString(), ""));
			pSeries[i].htmlLinks = convertList(getStringParam((new StringBuilder()).append("SERIE_LINKS_").append(i).toString(), ""));
			if (getStringParam((new StringBuilder()).append("SERIE_DATA_LABELS_").append(i).toString(), "").length() > 0)
				pSeries[i].dataLabels = convertList(getStringParam((new StringBuilder()).append("SERIE_DATA_LABELS_").append(i).toString(), ""));
		}

		if (linePlot != null && (linePlot instanceof CurvePlotter))
			((CurvePlotter)(CurvePlotter)linePlot).segments = getIntParam("CURVECHART_SEGMENTS", new Integer(24)).intValue();
		if (barPlot != null)
		{
			barPlot.barsBase = getDoubleParam("BARCHART_BASE", new Double(0.0D)).doubleValue();
			barPlot.summedLabels = getBooleanParam("BARCHART_SUMMED_LABELS", true);
			Integer in = getIntParam("BARCHART_BARWIDTH", null);
			if (in != null)
				barPlot.barWidth = in.intValue();
			in = getIntParam("BARCHART_BARSPACE", null);
			if (in != null)
				barPlot.interBarSpace = in.intValue();
			Double dob = getDoubleParam("BARCHART_GROUPSPACE", null);
			if (dob != null)
				barPlot.InterGroupSpace = dob.doubleValue();
		}
		if (barPlot3D != null)
		{
			barPlot3D.barsBase = getDoubleParam("BARCHART_BASE", new Double(0.0D)).doubleValue();
			barPlot3D.summedLabels = getBooleanParam("BARCHART_SUMMED_LABELS", true);
			Integer in = getIntParam("BARCHART_BARWIDTH", null);
			if (in != null)
				barPlot3D.barWidth = in.intValue();
			in = getIntParam("BARCHART_BARSPACE", null);
			if (in != null)
				barPlot3D.interBarSpace = in.intValue();
			Double dob = getDoubleParam("BARCHART_GROUPSPACE", null);
			if (dob != null)
				barPlot3D.InterGroupSpace = dob.doubleValue();
		}
		if (radarPlot != null)
		{
			Double d = getDoubleParam("RADARCHART_RADIUS", null);
			if (d != null)
				radarPlot.radiusModifier = d.doubleValue();
			radarPlot.drawCircle = getBooleanParam("RADARCHART_CIRCLE", false);
			fstyle = convertFillStyle(getStringParam("RADARCHART_BACK", ""));
			if (fstyle != null)
				radarPlot.backStyle = fstyle;
			if (getStringParam("RADARCHART_POINT_COLORS_SCALE", "").length() > 0)
				radarPlot.pointColorScale = convertDoubleList(getStringParam("RADARCHART_POINT_COLORS_SCALE", ""));
			if (getStringParam("RADARCHART_POINT_COLORS", "").length() > 0)
			{
				String listTMP[] = convertList(getStringParam("RADARCHART_POINT_COLORS", ""));
				radarPlot.pointColors = new ChartColor[listTMP.length];
				for (int j = 0; j < listTMP.length; j++)
					radarPlot.pointColors[j] = convertColor(listTMP[j]);

			}
			if (getStringParam("RADARCHART_FACTOR_COLORS", "").length() > 0)
			{
				String listTMP[] = convertList(getStringParam("RADARCHART_FACTOR_COLORS", ""));
				radarPlot.factorColors = new ChartColor[listTMP.length];
				for (int j = 0; j < listTMP.length; j++)
					radarPlot.factorColors[j] = convertColor(listTMP[j]);

			}
			lstyle = convertLineStyle(getStringParam("RADARCHART_BORDER", ""));
			if (lstyle != null)
				radarPlot.border = lstyle;
			lstyle = convertLineStyle(getStringParam("RADARCHART_GRID", ""));
			if (lstyle != null)
				radarPlot.gridStyle = lstyle;
			font = convertFont(getStringParam("RADARCHART_GRID_FONT", ""));
			if (font != null)
				radarPlot.gridFont = font;
			radarPlot.gridFontColor = convertColor(getStringParam("RADARCHART_GRID_FONT_COLOR", ""));
			font = convertFont(getStringParam("RADARCHART_FACTOR_FONT", ""));
			if (font != null)
				radarPlot.factorFont = font;
			radarPlot.factorColor = convertColor(getStringParam("RADARCHART_FACTOR_COLOR", ""));
			String tmpList = getStringParam("RADARCHART_FACTOR_MAX", "");
			if (tmpList.length() > 0)
				radarPlot.factorMaxs = convertDoubleList(tmpList);
			tmpList = getStringParam("RADARCHART_FACTOR_MIN", "");
			if (tmpList.length() > 0)
				radarPlot.factorMins = convertDoubleList(tmpList);
			tmpList = getStringParam("RADARCHART_FACTOR_NAMES", "");
			if (tmpList.length() > 0)
				radarPlot.factorNames = convertList(tmpList);
			tmpList = getStringParam("RADARCHART_TICKS", "");
			if (tmpList.length() > 0)
				radarPlot.ticks = (new Integer(tmpList)).intValue();
			radarPlot.tickLabelFormat = getStringParam("RADARCHART_TICK_FORMAT", "");
		}
		if (piePlot != null)
		{
			Double d = getDoubleParam("PIECHART_RADIUS", null);
			if (d != null)
				piePlot.radiusModifier = d.doubleValue();
			piePlot.effect3D = getBooleanParam("PIECHART_3D", false);
			lstyle = convertLineStyle(getStringParam("PIE_BORDER", ""));
			if (lstyle != null)
				piePlot.border = lstyle;
			lstyle = convertLineStyle(getStringParam("PIE_LABEL_LINE", ""));
			if (lstyle != null)
				piePlot.labelLine = lstyle;
		}
		if (gaugePlot != null)
		{
			Double d = getDoubleParam("GAUGE_RADIUS", null);
			if (d != null)
				gaugePlot.radiusModifier = d.doubleValue();
			gaugePlot.subGaugeSize = getIntParam("GAUGE_SUBGAUGE_SIZE", new Integer(30)).intValue();
			gaugePlot.axis2Margin = getIntParam("GAUGE_AXIS2_MARGIN", new Integer(40)).intValue();
			gaugePlot.axis2LabelMargin = getIntParam("GAUGE_AXIS2_LABEL_MARGIN", new Integer(-20)).intValue();
			GaugePlotter gp = null;
			GaugePlotter gp1 = null;
			GaugePlotter gp2 = null;
			for (int sb = 0; sb < 3; sb++)
			{
				String prefix = "";
				if (sb > 0)
					prefix = (new StringBuilder()).append("").append(sb).toString();
				gp = null;
				if (sb == 0)
					gp = gaugePlot;
				if (sb == 1 && getBooleanParam("GAUGE1_ENABLE", false))
				{
					gp = new GaugePlotter();
					gp1 = gp;
				}
				if (sb == 2 && getBooleanParam("GAUGE2_ENABLE", false))
				{
					gp = new GaugePlotter();
					gp2 = gp;
				}
				if (gp == null)
					continue;
				lstyle = convertLineStyle(getStringParam((new StringBuilder()).append("GAUGE").append(prefix).append("_BORDER").toString(), ""));
				if (lstyle != null)
					gp.border = lstyle;
				gp.needleBase = getIntParam((new StringBuilder()).append("GAUGE").append(prefix).append("_BASE").toString(), new Integer(8)).intValue();
				gp.axis1Margin = getIntParam((new StringBuilder()).append("GAUGE").append(prefix).append("_AXIS1_MARGIN").toString(), new Integer(5)).intValue();
				gp.axis1LabelMargin = getIntParam((new StringBuilder()).append("GAUGE").append(prefix).append("_AXIS1_LABEL_MARGIN").toString(), new Integer(10)).intValue();
				gp.maxZone = getDoubleParam((new StringBuilder()).append("GAUGE").append(prefix).append("_MAX_ZONE").toString(), new Double(-1D)).doubleValue();
				if (getStringParam((new StringBuilder()).append("GAUGE").append(prefix).append("_MAX_ZONE_COLOR").toString(), "").length() > 0)
					gp.maxZoneColor = new FillStyle(convertColor(getStringParam("GAUGE_MAX_ZONE_COLOR", "")));
				gp.minZone = getDoubleParam((new StringBuilder()).append("GAUGE").append(prefix).append("_MIN_ZONE").toString(), new Double(-1D)).doubleValue();
				if (getStringParam((new StringBuilder()).append("GAUGE").append(prefix).append("_MIN_ZONE_COLOR").toString(), "").length() > 0)
					gp.minZoneColor = new FillStyle(convertColor(getStringParam("GAUGE_MIN_ZONE_COLOR", "")));
				gp.maxminZoneWidth = getIntParam((new StringBuilder()).append("GAUGE").append(prefix).append("_MAXMIN_ZONE_WIDTH").toString(), new Integer(50)).intValue();
				gp.maxminZoneMargin = getIntParam((new StringBuilder()).append("GAUGE").append(prefix).append("_MAXMIN_ZONE_MARGIN").toString(), new Integer(5)).intValue();
				gp.endAngle = getIntParam((new StringBuilder()).append("GAUGE").append(prefix).append("_END_ANGLE").toString(), new Integer(200)).intValue();
				gp.startAngle = getIntParam((new StringBuilder()).append("GAUGE").append(prefix).append("_START_ANGLE").toString(), new Integer(-20)).intValue();
				fstyle = convertFillStyle(getStringParam((new StringBuilder()).append("GAUGE").append(prefix).append("_BACK").toString(), ""));
				if (fstyle != null)
					gp.gaugeback = fstyle;
			}

			gaugePlot.subGauge1 = gp1;
			gaugePlot.subGauge2 = gp2;
			gaugePlot.axis1 = cXAxis;
			if (gp1 != null)
				gp1.axis1 = cYAxis;
			if (gp2 != null)
				gp2.axis1 = cY2Axis;
			if (gp2 == null)
				gaugePlot.axis2 = cY2Axis;
			if (gp1 == null)
				gaugePlot.axis2 = cYAxis;
			cXAxis = null;
			cYAxis = null;
			cY2Axis = null;
		}
		Plotter plot = null;
		if (plot == null)
			plot = barPlot;
		if (plot == null)
			plot = barPlot3D;
		if (plot == null)
			plot = linePlot3D;
		if (plot == null)
			plot = linePlot;
		if (plot == null)
			plot = piePlot;
		if (plot == null)
			plot = radarPlot;
		if (plot == null)
			plot = gaugePlot;
		Chart chart = currentChart;
		if (chart == null)
			chart = new Chart();
		chart.resetChart(cTitle, plot, cXAxis, cYAxis);
		if (plot == piePlot)
			chart.resetChart(cTitle, plot, null, null);
		if (plot == radarPlot)
			chart.resetChart(cTitle, plot, null, null);
		chart.showTips = getBooleanParam("CHART_SHOW_TIPS", false);
		chart.showPosition = getBooleanParam("CHART_SHOW_POSITION", false);
		chart.activateSelection = getBooleanParam("CHART_POINT_SELECTION", false);
		chart.onClickJSFunction = getStringParam("CHART_ON_CLICK_FUNCTION", chart.onClickJSFunction);
		if (chart.showTips)
			chart.activateSelection = true;
		if (chart.showPosition)
			chart.activateSelection = true;
		for (int noteCount = 1; getStringParam((new StringBuilder()).append("CHART_NOTE").append(noteCount).toString(), "").length() > 0; noteCount++)
			chart.addNote(getStringParam((new StringBuilder()).append("CHART_NOTE").append(noteCount).toString(), ""));

		chart.tipColor = convertColor(getStringParam("CHART_TIPS_COLOR", "YELLOW"));
		chart.tipFontColor = convertColor(getStringParam("CHART_TIPS_FONT_COLOR", "BLACK"));
		chart.tipFont = convertFont(getStringParam("CHART_TIPS_FONT", "SERIF|PLAIN|10"));
		chart.htmlLinkTarget = getStringParam("CHART_LINKS_TARGET", "_new");
		chart.repaintAll = true;
		chart.XLabel = cXLabel;
		chart.YLabel = cYLabel;
		chart.Y2Label = cY2Label;
		if (cY2Axis != null)
			chart.setY2Scale(cY2Axis);
		if (piePlot != null && piePlot != plot)
			chart.addPlotter(piePlot);
		if (linePlot != null && linePlot != plot)
			chart.addPlotter(linePlot);
		if (linePlot3D != null && linePlot3D != plot)
			chart.addPlotter(linePlot3D);
		if (barPlot3D != null && barPlot3D != plot)
			chart.addPlotter(barPlot3D);
		if (barPlot != null && barPlot != plot)
			chart.addPlotter(barPlot);
		if (gaugePlot != null && gaugePlot != plot)
			chart.addPlotter(gaugePlot);
		if (getBooleanParam("LEGEND", true))
			chart.legend = clegend;
		plegendPosition = getStringParam("LEGEND_POSITION", "RIGHT");
		if (plegendPosition.compareTo("RIGHT") == 0)
			chart.layout = 0;
		if (plegendPosition.compareTo("BOTTOM") == 0)
			chart.layout = 2;
		if (plegendPosition.compareTo("TOP") == 0)
			chart.layout = 1;
		Double d = getDoubleParam("LEFT_MARGIN", null);
		if (d != null)
			chart.leftMargin = d.doubleValue();
		d = getDoubleParam("RIGHT_MARGIN", null);
		if (d != null)
			chart.rightMargin = d.doubleValue();
		d = getDoubleParam("TOP_MARGIN", null);
		if (d != null)
			chart.topMargin = d.doubleValue();
		d = getDoubleParam("LEGEND_MARGIN", null);
		if (d != null)
			chart.legendMargin = d.doubleValue();
		d = getDoubleParam("BOTTOM_MARGIN", null);
		if (d != null)
			chart.bottomMargin = d.doubleValue();
		lstyle = convertLineStyle(getStringParam("CHART_BORDER", ""));
		if (lstyle != null)
			chart.border = lstyle;
		fstyle = convertFillStyle(getStringParam("CHART_FILL", ""));
		if (fstyle != null)
			chart.back = fstyle;
		if (getBooleanParam("CHART_FULL_XAXIS", false))
			chart.fullXAxis = true;
		double tmpDouble = getDoubleParam("CHART_SECOND_AXIS_MARGIN", new Double(0.0D)).doubleValue();
		chart.secondYAxisMargin = tmpDouble;
		if (getStringParam("CHART_AXIS_MARGIN", "").length() > 0)
			chart.axisMargin = getDoubleParam("CHART_AXIS_MARGIN", new Double(0.0D)).doubleValue();
		String backImageStr = getStringParam("BACK_IMAGE", "");
		if (backImageStr.compareTo("") != 0)
		{
			com.java4less.rchart.gc.ChartImage im2 = null;
			im2 = GraphicsProvider.getImage(backImageStr);
			chart.backImage = im2;
		}
		chart.repaintAll = true;
		chart.repaintAlways = true;
		gChart = chart;
		if (getStringParam("DOUBLE_BUFFERING", "").toUpperCase().compareTo("NO") == 0)
			chart.doubleBuffering = false;
		chart.virtualWidth = (int)getDoubleParam("CHART_WIDTH", new Double(0.0D)).doubleValue();
		chart.virtualHeight = (int)getDoubleParam("CHART_HEIGHT", new Double(0.0D)).doubleValue();
		for (int zoneNr = 1; getParameter((new StringBuilder()).append("CHART_TARGET_ZONE_").append(zoneNr).toString(), "").length() > 0; zoneNr++)
			chart.addTargetZone(TargetZone.createFromString(getParameter((new StringBuilder()).append("CHART_TARGET_ZONE_").append(zoneNr).toString(), "")));

		chart.msecs = getIntParam("REALTIME_MSECS", new Integer(2000)).intValue();
		chart.reloadFrom = getParameter("REALTIME_DATAFILE", "");
		int w = 500;
		int h = 500;
		try
		{
			w = (new Integer(getStringParam("WIDTH", "500"))).intValue();
			h = (new Integer(getStringParam("HEIGHT", "500"))).intValue();
		}
		catch (Exception err) { }
		chart.setWidth(w);
		chart.setHeight(h);
		if (jdbcsource != null)
			jdbcsource = null;
		chart.loader = this;
		return chart;
	}

	private void loadDataFromFile(InputStream is, String userpsw)
	{
		String fileData = "";
		String param = "";
		String value = "";
		try
		{
			BufferedReader in = null;
			in = new BufferedReader(new InputStreamReader(is));
			for (String inputLine = ""; (inputLine = in.readLine()) != null;)
				fileData = (new StringBuilder()).append(fileData).append(inputLine).append('\r').append('\n').toString();

			in.close();
		}
		catch (Exception e)
		{
			Log.e(",J4LChart", "Could not read input stream ", e);
		}
		String line = "";
		do
		{
			if (fileData.length() <= 0)
				break;
			int p = fileData.indexOf("\r\n");
			int p2 = fileData.indexOf("\n");
			if (p <= p2 && p >= 0)
			{
				line = fileData.substring(0, p);
				fileData = fileData.substring(p + 2, fileData.length());
			}
			if (p > p2 && p2 >= 0)
			{
				line = fileData.substring(0, p2);
				fileData = fileData.substring(p2 + 1, fileData.length());
			}
			if (p2 == -1 && p == -1)
			{
				line = fileData;
				fileData = "";
			}
			p = line.indexOf("=");
			if (p > -1)
			{
				param = line.substring(0, p);
				value = line.substring(p + 1, line.length());
				param = param.toUpperCase();
				boolean alreadyFound = false;
				for (int h = 0; h < loadedParametersCount; h++)
					if (loadedParameters[h].compareTo(param) == 0)
					{
						loadedValues[h] = value;
						alreadyFound = true;
					}

				if (!alreadyFound)
				{
					loadedParameters[loadedParametersCount] = param;
					loadedValues[loadedParametersCount] = value;
					loadedParametersCount++;
				}
			}
		} while (true);
	}

	public int getLoadedParametersCount()
	{
		return loadedParametersCount;
	}

	public String getLoadedParameter(int i)
	{
		return loadedParameters[i];
	}

	public String getLoadedValue(int i)
	{
		return loadedValues[i];
	}

	public void setDataFile(String df)
	{
		dataFile = df;
	}

	public Chart build(boolean clear, boolean reReadFile)
	{
		return build(null, clear, reReadFile);
	}

	public Chart build(Chart currentChart, boolean clear, boolean reReadFile)
	{
		if (clear)
			loadedParametersCount = 0;
		String pFile;
		if (reReadFile)
			pFile = dataFile;
		if (getStringParam("PAINT_DIRECT", "").compareTo("NO") == 0)
			paintDirect = false;
		return buildChart(currentChart);
	}

	public void clearParams()
	{
		loadedParametersCount = 0;
	}

	public void loadFromFile(InputStream is, boolean Clear)
	{
		if (Clear)
			loadedParametersCount = 0;
		loadDataFromFile(is, "");
	}

	public void setParameter(String param, String value)
	{
		boolean alreadyFound = false;
		for (int h = 0; h < loadedParametersCount; h++)
			if (loadedParameters[h].compareTo(param) == 0)
			{
				loadedValues[h] = value;
				alreadyFound = true;
				return;
			}

		if (!alreadyFound)
		{
			loadedParameters[loadedParametersCount] = param;
			loadedValues[loadedParametersCount] = value;
			loadedParametersCount++;
		}
	}
}
